#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
int main()
{
	long long x,y,sum=0;
	cin>>x>>y;
	if(abs(x)>abs(y)){
		if(abs(x)-1==abs(y))
			sum=(2*abs(x)-1)*(2*abs(x)-1);
		else if(x<0)
			sum=(2*abs(x)-1)*(2*abs(x)-1)-(x+1)+y;
		else
			sum=4*x*x+x-y;
	} 
	else if(abs(x)<abs(y)){
		if(y>0)
			sum=4*y*y-y+x;
		else
			sum=(2*abs(y)-1)*(2*abs(y)-1)-(y+1)+x;
	}
	else{
		if(x==y)
			if(x>0&&y>0)
				sum=(x+y)*(x+y);
			else
				sum=(abs(x)+abs(y)+1)*(abs(y)+abs(x)+1)-1;
		else{
			if(x>0&&y<0)
				sum=(x+y)*(x+y)+2*x;
			else
				sum=(x+y)*(x+y)-2*y;
		}
	}
	cout<<sum<<endl;
	return 0;
}
